//
//  Untitled.swift
//  hello
//
//  Created by yafei li on 2025/9/16.
//
import Vapor
 
extension HTTPResponseStatus {
    /// 用户已存在
    static var userExist: HTTPResponseStatus {
        .custom(code: 20000, reasonPhrase: "用户已存在")
    }
    /// 用户不存在
    static var userNotExist: HTTPResponseStatus {
        .custom(code: 20001, reasonPhrase: "用户不存在")
    }
    /// 密码错误
    static var passwordError: HTTPResponseStatus {
        .custom(code: 20002, reasonPhrase: "密码错误")
    } 
}
extension Abort{ 
    static var userExist: Abort {
        return Abort(.userExist,reason: "用户已存在")
    }
    static var userNotExist: Abort {
        return Abort(.userNotExist,reason: "用户不存在")
    }
    static var passwordError: Abort {
        return Abort(.passwordError,reason: "密码错误")
    }
}
